<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
    <script src="../vuejs/vue.js"></script>
    <template id="my-app">
        <!-- 默认传入event对象，可以在方法中获取 -->
        <button @click="btnClick">按钮</button>
        <!-- $event可以获取到事件发生时的事件对象 -->
        <button @click="btn2Click($event,'code',18)">按钮2</button>
    </template>
    <script>
        Vue.createApp({
            template:`#my-app`,
            data(){
                return{
                    counter:0
                }
            },
            methods:{
                btnClick(){
                    console.log(event);
                },
                btn2Click(event,name,age){
                    console.log(name ,age,event);
                }
            }

        }).mount('#app')
    </script>
</body>
</html>